﻿using System;
using System.Linq;
namespace LeetCode {
    class Program {
        static void Main (string[] args) {
            Solution sln = new Solution ();
            bool match = sln.IsMatch ("aab", "c*a*b");
            dpMatch dpM = new dpMatch ();
            Recursion recursion = new Recursion ();
            bool dpmt = dpM.isMatch ("aab", "c*a*b");
            bool dpumt = dpM.isupMatch ("aaaaabbbbbd", "c*a*b*d");
            bool recu = recursion.isMatch ("aaaaabbbbbd", "c*a*b*d");
            Console.WriteLine (match);
            Console.WriteLine (dpmt);
            Console.WriteLine (dpumt);
            Console.WriteLine (recu);
            string temp = ((Func<string>) (() => { return "test"; })) ();
            //lambda statement
            Func<string> strtemp = () => {
                Console.WriteLine ("---Test1----");
                return "test";
            };
            Console.WriteLine (strtemp ());
            wildcard wildc = new wildcard ();
            bool wil = wildc.IsMatch ("caabbbd", "ca*b*?");
            Console.WriteLine (wil);
            LPS lPS = new LPS ();
            Console.WriteLine ("---Test2----");
            Console.WriteLine (lPS.LongestPalindrome ("cbbd"));
            Console.WriteLine ("---Test3----");
            Console.WriteLine (lPS.LongestPalindromes ("cbbd"));
            Console.WriteLine ("---Test4----");
            Console.WriteLine (lPS.LongestPalindrome1 ("abbaabccba"));
            Console.WriteLine ("---Test5----");
            LongestPalindrome longest = new LongestPalindrome ();
            Console.WriteLine (longest.LongestPalindromeSubseq ("BBABCBCAB"));
            Console.WriteLine (longest.LongestPalindromeSubseq1 ("ABCDDCEFA"));
            Console.WriteLine (longest.LongestPalindromeSubseq2 ("ABCDDCEFA"));
            LVP lVP = new LVP ();
            Console.WriteLine (lVP.LongestValidParentheses ("((((()))))()((())))))))"));
            Console.WriteLine (lVP.longestValidParentheses ("((()(()))))()((())))))))"));
            MaxArea maxarea = new MaxArea ();
            Console.WriteLine (maxarea.MaxRectangleArea (new int[] { 2, 1, 3, 5, 2, 9, 7, 3 }));
            Rectangle rect = new Rectangle ();
            char[][] maxtrix = new char[4][] {
                new char[] { '1', '0', '1', '0', '0' }, new char[] { '1', '0', '1', '1', '1' }, 
                new char[] { '1', '1', '1', '1', '1' }, new char[] { '1', '0', '1', '0', '1' }
            };
            Console.WriteLine (rect.MaximalRectangle (maxtrix));
            Console.WriteLine (rect.maximalRectangle (maxtrix));
            Console.WriteLine (rect.MaximalRectangle1 (maxtrix));
            tree trees=new tree();
            Console.WriteLine(trees.IsScramble("great","rgeat"));
            Console.WriteLine(trees.IsScramble("abcde","caebd"));
            Console.WriteLine(trees.IsScramble("Scramble","bleScamr"));
            Console.WriteLine(trees.IsScramble1("Scramble","bleScamr"));
            Console.WriteLine(trees.IsScramble1("great","rgtea"));
            Console.WriteLine(trees.isScramble("great","rgtea"));
            EncodingMethod encoding=new EncodingMethod();
            Console.WriteLine(encoding.NumDecodings("great"));
            decoding decode= new decoding();
            Console.WriteLine(decode.NumDecodings("1212"));
            Console.WriteLine(decode.NumDecodings1("1212"));
            Console.WriteLine(decode.NumDecodings2("1212"));
            Console.WriteLine(decode.NumDecodings1("12713"));
            Console.WriteLine(decode.NumDecodings2("12713"));
            Console.WriteLine(decode.NumDecodings3("12713"));
            BST bST= new BST();
            Console.WriteLine(bST.NumTrees(4));
            Console.WriteLine(bST.numTrees1(4));
            Console.WriteLine(bST.numTrees2(4));
        }
    }
}